<?php
$line1 = $line2 = $line3= '';

$cartype    = Model_Listing_Car::getCarType();
$tmp        = $this->listing->cartype;

$cartypes = '';
if (!empty($tmp) && !empty($cartype[$tmp])) {
    $cartypes = $cartype[$tmp];
}

?>
<dd class="detail">
    <?php
    $to_add  = '';
    if (!empty($this->listing->make)) {
        $make_name = $this->listing->make->name;
        $line1 = '<a href="'.Ac_Util::getCrossLink($this->listing->make->_id, 'make', $this->listing).'">'.$make_name.'</a>';
        $to_add = ', ';
    }

    if (!empty($this->listing->model)) {
        $model_name = $this->listing->model->name;
        $line1 .= $to_add . '<a href="'.Ac_Util::getCrossLink($this->listing->model->_id, 'model', $this->listing).'">'.$model_name.'</a>';
        $to_add = ', ';
    }

    $to_add = '';
    if (!empty($this->listing->yearmanufactured)) {
        $line2 = (int)$this->listing->yearmanufactured.'年';
        $to_add = ', ';
    }

    if (!empty($cartypes) && !empty($this->listing->cartype) && !empty($cartype)) {
        $line2 .= $to_add . '<a href="'.Ac_Util::getCrossLink($this->listing->cartype, 'cartype', $this->listing).'">'.$cartypes.'</a>';
        $to_add = ', ';
    }
    

    echo $line1;
    echo !empty($line1) && !empty($line2) ? '<br>' : '';
    echo $line2;
    ?>
</dd>
